<template>
	<view style="padding: 40rpx 24rpx;">
		<view style="padding: 28rpx 32rpx;background: #FFFFFF;
		border-radius: 14rpx;font-size: 32rpx;margin-bottom: 36rpx;" v-for="(item,index) in loglist" :key="index">
		<view style="display: flex;justify-content: space-between;font-weight: 600;" >
			<view >{{item.title}}{{item.change}}</view>
			<view :style="'color:'+item.color" style="font-size: 28rpx;letter-spacing: 1rpx;">{{item.text}}</view>
		</view>
		<view style="margin-top: 30rpx;font-size: 28rpx;color: #686868;
line-height: 40rpx;">
            <view  style="margin-bottom: 20rpx;">申请编号：888786787777</view>
			<view  style="margin-bottom: 20rpx;">申请时间：{{item.add_time}}</view>
			<view style="margin-bottom: 20rpx;" v-if="item.status!=2">实际到账 ：88.99</view>
			<view style="margin-bottom: 20rpx;" v-if="item.status==2">驳回原因：没有原因</view>
			<view style="margin-bottom: 20rpx;" v-if="item.status==1" >完成时间：  {{item.time}}</view>
			
		</view>
					
				</view>
				<u-loadmore :status="status" />
		
	</view>
</template>

<script>
	var that;
	import {
		getCommissionInfo
	} from '@/api/user.js';
	export default {
		data() {
			return {
			loglist:[
			{title:'积分提现  1000.00',add_time:'2024-02-29 09:46:21',status:0,update_time:'2024-02-29 09:46:21',text:'待审核',color:'#D9001C'},
			{title:'积分提现  1000.00',add_time:'2024-02-29 09:46:21',status:2,update_time:'2024-02-29 09:46:21',text:'已驳回',color:'#05A7F0'},
			{title:'积分提现  1000.00',add_time:'2024-02-29 09:46:21',status:1,update_time:'2024-02-29 09:46:21',text:'已通过',color:'#F6A03C'}],
			page: 1,
			limit: 10,
			status: 'loadmore',
			page: 1,
			pages:'',
			}
		},
		onLoad() {
			that=this
			that.getexchangelog()
		},
		onReachBottom() {
			console.log('that.pages.length',this.pages.length)
				if(this.pages.length < this.limit) return ;
				this.status = 'loading';
				this.page = ++ this.page;
				this.getexchangelog()
			},
		methods: {
			
			getexchangelog(){
				getCommissionInfo({
					page: that.page,
					limit: that.limit
				},4).then(res => {
					let data = res.data
					that.pages=data.list
					if(that.page==1){
						that.loglist=data.list
					}else{
						that.loglist = that.loglist.concat(data.list);
					}
					that.loglist.forEach((item, index) => {
						switch (item.status) {
							case 0:
								item.text ='审核中'
								item.color='#D9001C'
								break
							case 1:
								item.text ='已通过'
								item.color='#F59A23'
								break
							case 2:
								item.text ='已驳回'
								item.color='#05A7F0'
								break
							
						}
					})
					if(that.pages.length < that.limit) that.status = 'nomore';
					else that.status = 'loading';
					console.log('that.loglist',that.loglist)
				
				}).catch(err => {
							return this.$util.Tips({
								title: err
							});
						});
			}
		}
	}
</script>

<style>

</style>
